#pragma once

// Reference: http://msdn.microsoft.com/en-us/library/windows/apps/dd293608.aspx
// Lambdas vs. Function Objects
void lambdaAction(void);
void funcObjectAction(void);


// References: http://msdn.microsoft.com/en-us/library/windows/apps/dd293603.aspx
// Lambda Expression Syntax
void lambdaProfileAction(void);
void mutableTestAction(void);


#include <iostream>
class FuncClass
{
public:
	// The required constructor for this example
	explicit FuncClass(int& evenCount) : _evenCount(evenCount) {}

	// The function-call operator points whether the number is even or odd, 
	// If the number is even, this method updates the counter.
	void operator()(int n) const {
	 	std::cout << "Fetch " << n;
		if (n % 2 == 0) {
			std::cout << " is even " << std::endl;
			++_evenCount;
		}
		else {
			std::cout << " is odd " << std::endl;
		}
	}

protected:
	int& _evenCount;
};